import 'dart:convert';

import 'dart:math';

main() {
  var uri = Uri.parse('http://.baidu.com');


}

bb(){
  try {
    var ad= ga();
    print(ad);
  } catch (e) {
    print("二次捕获$e");
  }
}
ga() async {
  try {
  await   AA();
  } catch (e) {
    print("一次捕获$e");
    rethrow;
  }
}

AA() {
  throw "bbb";
}

b() {
  String signature = "oUWKYeqCEojOvbmsynvWTctJSAVeoMZv";
  int Min = 99999;
  int Max = 999999;
  var rng = new Random();

  int random = Min + rng.nextInt(Max - Min);
  //时间戳是13位的毫秒,1000毫秒=1秒,所以需要除以一千 得到的是秒的时间戳也就是10位的
  var currentTimeMillis =
      (new DateTime.now().millisecondsSinceEpoch / 1000).toInt();

  print(currentTimeMillis);
  StringBuffer stringBuffer = new StringBuffer();
  var tmp = "$currentTimeMillis$random$signature";
  print(tmp);
  var uri = Uri.parse("http://127.0.0.1:38");
  print(uri);
}

void a() {
  try {
    var ts = "王大拿";
    var bytes = utf8.encode(ts);
    var urlBase = base64Encode(bytes);

    /// base64-->List<int>-->String
    ///
    String newImage = utf8.decode(base64Decode(urlBase));
    print(newImage);
    ts.runes.forEach((int rune) {
      var character = new String.fromCharCode(rune);
      ascii.encode(character);
      print(character);
    }); //原文出自【易百教程】，商业转载请联系作者获得授权，非商业请保留原文链接：https://www.yiibai.com/dart/dart_programming_runes.html

  } catch (e, s) {
    print('堆栈信息:\n $e');
    print('堆栈信息:\n $s');
  }
}
